import $api from './index';

// 获取kfc列表
interface GetKfcListParams {
  keyword?: string;
}
export const getKfcList = async ({ keyword }: GetKfcListParams) => {
  const withA = keyword ? `a=${keyword}` : '';

  const res = await $api.get(`/kfc?${withA}`);
  return res;
};

// 添加一个abc
interface AddKfcParams {
  a?: string;
  b?: string | number;
  c?: string;
}
export const addKfc = async (data: AddKfcParams) => {
  const res = await $api.post(
    '/kfc', // 请求地址
    {
      // 发送的数据
      ...data,
    },
  );

  return res;
};
export default {};
